Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
Sketch can take up even a multiple megabytes, but shouldn't.
Causes (Optional)
We have a single file
image_attachment
for keeping all temporary images that are about to be uploaded and sent.When we take a photo, this file is cleared completely but when we create a sketch, we write to that file but not clear it first. This makes it so that the file's metadata can still have the size of the previous sent image, for instance photo that user took to send.
Solutions
Use
rwt
mode instead ofrw
when opening file descriptor to write sketch paths to this temporary file, this way it will be truncated before creating a new sketch.Testing
How to Test
Take a big photo to send and then send a sketch - check how big is this sketch file.
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.